home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / kernel / vm / ds5000.md / vmMach.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-19  |  3.1 KB  |  104 lines

  1. /*
  2.  * vmMach.h
  3.  *
  4.  *         Machine dependent virtual memory data structures and procedure
  5.  *    headers.
  6.  *
  7.  * Copyright (C) 1989 Digital Equipment Corporation.
  8.  * Permission to use, copy, modify, and distribute this software and
  9.  * its documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appears in all copies.
  11.  * Digital Equipment Corporation makes no representations about the
  12.  * suitability of this software for any purpose.  It is provided "as is"
  13.  * without express or implied warranty.
  14.  *
  15.  * $Header: /cdrom/src/kernel/Cvsroot/kernel/vm/ds5000.md/vmMach.h,v 1.4 92/10/27 09:04:50 mgbaker Exp $ SPRITE (DECWRL)
  16.  */
  17.  
  18. #ifndef _VMMACH
  19. #define _VMMACH
  20.  
  21. #ifdef KERNEL
  22. #include <vm3maxConst.h>
  23. #else
  24. #include <kernel/vm3maxConst.h>
  25. #endif
  26.  
  27. /*
  28.  * Machine dependent data for each software segment.
  29.  */
  30. typedef struct VmMach_SegData {
  31.     int    dummy;
  32. } VmMach_SegData;
  33.  
  34. /*
  35.  * Machine dependent shared memory data
  36.  */
  37. typedef struct VmMach_SharedData {
  38.     int        *allocVector;           /* Allocated block vector. */
  39.     int         allocFirstFree;         /* First free block. */
  40. } VmMach_SharedData;
  41.  
  42. /*
  43.  * Structure to allow processes to share regions of their VA with the kernel.
  44.  */
  45.  
  46. typedef struct VmMach_KernSharedInfo {
  47.     List_Links    links;
  48.     unsigned    firstPage;        /* First virtual page in region. */
  49.     unsigned    lastPage;        /* Last virtual page in region. */
  50.     unsigned    firstPhysPage;        /* First physical page, if region
  51.                      * is in the user mapping region. */
  52.     int        flags;            /* See below. */
  53. } VmMach_KernSharedInfo;
  54.  
  55. /*
  56.  * Flags in a VmMach_KernSharedInfo.
  57.  */
  58.  
  59. #define VMMACH_KERN_SHARED_UNCACHEABLE 1    /* Is region uncacheable? */
  60.  
  61. /*
  62.  * Machine dependent data for each process.
  63.  */
  64. typedef struct VmMach_ProcData {
  65.     struct Vm_Segment    *mapSegPtr;    /* Pointer to segment which is mapped
  66.                      * into this processes address
  67.                      * space. */
  68.     unsigned int    mappedPage;    /* Page in the mapped seg where
  69.                      * the mapping begins. */
  70.     int            pid;        /* Which pid is used to map this
  71.                      * process. */
  72.     unsigned int    modPage;    /* A TLB modified fault occured on this
  73.                      * virtual page - set the modify bit
  74.                      * in the TLB entry if we try to
  75.                      * validate this VA. */
  76.     Address        sharedPtr;    /* Shared memory pointer, in case
  77.                      * shared memory is mapped.
  78.                      * This is really Vm_SegProcList*, 
  79.                      * but made address because of
  80.                      * header file problems.*/
  81.     VmMach_SharedData    sharedData;    /* Data for shared memory. */
  82.     List_Links        kernSharedList;    /* List of VA regions shared with
  83.                      * the kernel. */
  84. } VmMach_ProcData;
  85.  
  86. /*
  87.  * TLB Map.
  88.  */
  89. extern unsigned *vmMach_KernelTLBMap;
  90.  
  91. /*
  92.  * Machine dependent functions exported to machine dependent modules.
  93.  */
  94.  
  95. extern Boolean VmMach_MakeDebugAccessible _ARGS_((unsigned addr));
  96. extern ENTRY ReturnStatus VmMach_TLBFault _ARGS_((Address virtAddr));
  97. extern ReturnStatus VmMach_TLBModFault _ARGS_((Address virtAddr));
  98. extern ReturnStatus VmMach_UserMap _ARGS_((int numBytes, Address addr,
  99.     Address physAddr, Boolean cache, Address *newAddrPtr));
  100. extern ENTRY ReturnStatus VmMach_UserUnmap _ARGS_((Address addr));
  101. extern int VmMachCopyEnd _ARGS_((void));
  102.  
  103. #endif _VMMACH
  104.